<?php

namespace common\libraries;

use Yii;

/**
 *
 */
class WriteLogSrv
{

    public static function writeLog($content)
    {
        $dir = '/data/log/cal/' . date('Ymd') . '.log';
        $fileExists = file_exists($dir);
        file_put_contents($dir, date('Y-m-d H:i:s') . '：' . $content . "\n\n", FILE_APPEND);
        if (!$fileExists) {
            chmod($dir, 0777);
        }
    }

}